import pinia from "@/stores/index";
import { createApp } from "vue";
import App from "./App.vue";
import router from "./router";
// import "@/assets/main.scss";
import "@/style/index.scss";
import "element-plus/dist/index.css";
import "./permission";
//暗黑模式需要的样式
import "element-plus/theme-chalk/dark/css-vars.css";
import elFormRenderer from "./components/femessage/el-form-renderer.vue";
import ElementPlus from "element-plus";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
import zhCn from "element-plus/dist/locale/zh-cn.mjs";
import { isHasButton } from "./directive/has";
const app = createApp(App);

app.component("elFormRenderer", elFormRenderer);
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  // 新增名为Menu的判断
  if ("Menu" != key) {
    app.component(key, component);
  } else {
    app.component(key + "Icon", component);
  }
}
app.use(pinia);
app.use(router);
isHasButton(app);

app.use(ElementPlus, {
  locale: zhCn,
});
app.mount("#app");
